{extends file="../home.html"}
{block name="title"}{$head_title}{/block}
{block name="css"}
<!-- <link rel="stylesheet" style="text/css" href="__PUBLIC__/Css/front/user_glb.css?version={$version}"> -->
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/front/front_css/refresh_load.css?version={$version}"/>
<style type="text/css">
<style type="text/css">
    body,html{
    	padding-top:2.2rem;
    }
    #load_wrapper{
    	top:2.2rem;
    }
</style>
{/block}
{block name="content"}
{include file="../common_header.html"}
<div id="load_wrapper">
<div id="scroller">
<div id="pullDown">
    <span class="pullDownIcon"></span>
</div>
    <ul class="clearfix project_type_tab">
        <li class="fl">
            <div class="type_tab_box clearfix">
                <p class="fl" id="site_type">场地类型</p>
                <i class="fl icon icon_screen_default3x icon_up3x"></i>
            </div>
        </li>
        <li class="fl">
            <div class="type_tab_box clearfix">
                <p class="fl" id="territory">地域</p>
                <i class="fl icon icon_screen_default3x icon_up3x"></i>
            </div>
        </li>
    </ul>
   <!-- <div class="project_bg" style="display:none;"></div>-->
    <div class="project_type_list">
        <dl class="project_tab_menu site_type" style="display:none;">
            <dd class="clearfix active" data-site_type_id = "0">
                <p class="fl">全部</p>
                <i class="fr icon icon_sele3x"></i>
            </dd>
            {foreach from = $site_type_list item = type}
            <dd class="clearfix" data-site_type_id = "{$type.type_id}">
                <p class="fl">{$type.type_name}</p>
                <i class="fr icon icon_sele3x"></i>
            </dd>
            {/foreach}
        </dl>
        <dl class="project_tab_menu city_id" style="display:none;">
            <dd class="clearfix" data-city_id = "0">
                <p class="fl">全部</p>
                <i class="fr icon icon_sele3x"></i>
            </dd>
            {foreach from = $city_list item = city}
            <dd class="clearfix {if $city_id == $city.city_id}active{/if}" data-city_id = "{$city.city_id}">
                <p class="fl">{$city.city_name}</p>
                <i class="fr icon icon_sele3x"></i>
            </dd>
            {/foreach}
        </dl>
    </div>
<div class="site_list">
    {foreach from=$site_list item = site}
    <a href="/FrontSite/site_detail/site_id/{$site.site_id}" class="activity_bg">
        <img src="{$site.pic_arr[0]}" alt=""/>
        <div class="activity_bg_box">
            <h6>{$site.site_name}</h6>
            <p>{$site.address}</p>
            <span>{$site.site_type_name}</span>
        </div>
    </a>
    {/foreach}
</div>
<div id="pullUp">
    <span class="pullUpIcon"></span><span class="pullUpLabel">上拉加载...</span>
</div>
</div>
</div>
 <div class="project_bg" style="display:none;"></div>
{/block}
{block name="js"}
<script>

    var site_type_id = 0;
    var city_id = 0;
    var total = parseInt({$total});
    var firstRow = parseInt({$firstRow});
    var key_words = '{$key_words}';
</script>
{literal}
<script type="text/javascript" src="__PUBLIC__/Js/front/front_js/site_circle.js"></script>
<script type="text/javascript" src="__PUBLIC__/Js/front/iscroll.js"></script>
<script src="__PUBLIC__/Js/front/front_js/get_site_list.js" type="text/javascript" charset="utf-8"></script>

        <script type="text/javascript">

            $("#territory").html($(".city_id").children(".active").children("p").html());

            $("#site_type").html($(".site_type").children(".active").children("p").html());

            $(".city_id dd").on("click",function(){
                var html = ($(this).children("p").html());
                $("#territory").html(html);
            });
            $(".site_type dd").on("click",function(){
                var html = ($(this).children("p").html());
                $("#site_type").html(html);
            });
//            var html = ($(this).children("p").html());
//
//            if($(this).children("p").hasClass("site_type_p")){
//                $("#site_type").html(html)
//            }else{
//                $("#territory").html(html)
//            }
        </script>
{/literal}
{/block}